package com.example.backend.service.mysql.permission.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.backend.entitly.mysql.permission.UserRoles;
import com.example.backend.mapper.mysql.permission.UserRolesMapper;
import com.example.backend.service.mysql.permission.UserRolesService;
import org.springframework.stereotype.Service;

/**
 * @author 1
 * @description 针对表【user_roles(用户角色关联表)】的数据库操作Service实现
 * @createDate 2025-06-04 09:01:52
 */
@Service
public class UserRolesServiceImpl extends ServiceImpl<UserRolesMapper, UserRoles>
        implements UserRolesService {

    @Override
    public boolean savaByUser(Integer userId, Integer byDefaultName) {
        UserRoles userRoles = new UserRoles();
        userRoles.setUserId(userId);
        userRoles.setRoleId(byDefaultName);
        return save(userRoles);
    }
}




